1. The Field of the Invention
The present invention relates to the fields of distributed computing systems, client-server computing and object-oriented programming. More specifically, the present invention includes a method and apparatus for managing objects that are associated through relationship objects in a distributed object environment.
2. The Relevant Art
Object oriented programming methodologies have received increasing attention over the past several years in response to the increasing tendency for software developed using traditional programming methods to be delivered late and over budget (Taylor 1990; Gibbs 1994). One problem with traditional programming techniques stems from the emphasis placed on procedural models and xe2x80x9clinearxe2x80x9d code that often is extremely difficult to design and maintain for many problems. Generally, large programs created using traditional methods are xe2x80x9cbrittlexe2x80x9d, that is, even small changes can effect all elements of the programming code. Thus, minor changes made to the software in response to user demands can require major redesign and rewriting of the entire program.
Object oriented programming strategies tend to avoid these problems because object methodologies focus on manipulating data rather than procedures; thus providing the programmer with a more intuitive approach to modeling real world problems. In addition objects encapsulate related data and procedures so as to hide that information from the remainder of the program by allowing access to the data and procedures only through the object""s interface. Hence changes to the data and or procedures of the object are relatively isolated from the remainder of the program. This provides code that is more easily maintained as compared to code written using traditional methods, as changes to an object""s code do not affect the code in the other objects. In addition, the inherent modular nature of objects allows individual objects to be reused in different programs. Thus, programmers can develop libraries of xe2x80x9ctried and truexe2x80x9d objects that can be used over and over again in different applications. This increases software reliability while decreasing development time, as reliable programming code may be used repeatedly.
However, the full promise of object oriented methodologies, especially the advantages afforded by their modularity, have yet to be achieved. In particular, it would be highly desirable to allow programmers and other users access to objects in a transparent fashion so that objects created in different programming languages and objects residing on different computing platforms that are networked together are accessible to the user without extensive modification of the user""s programming code.
Attempts to provide such facilities have been made using object oriented distributed systems that are based upon a client-server model, in which object-servers provide interfaces to object-clients that make requests of the object-servers. Typically in such systems, these servers are objects consisting of data and associated methods. The object-clients obtain access to the functionalities of the object-servers by executing calls on them, which calls are mediated by the distributed system. When the object-server receives the call it executes the appropriate method and transmits the result back to the object-client. The object-client and object-server communicate through an Object Request Broker (ORB) which is used to locate the various distributed objects and establish communications therebetween (Rao 1993).
The object metaphor in distributed systems is a useful technique as it separates the object""s interface from its implementation; thus allowing software designers to take advantage of the functionalities of various objects available to them without having to worry about the details of the object""s implementation. The programmer need only be aware of the object""s interface. In addition, object oriented distributed systems allow for multiple implementations of a single interface, which interface may reside on different computing platforms that have been connected through a network. Thus, a programmer working on one machine of a network may make a call to an object about which the programmer has no detailed knowledge with the confidence that at the appropriate time that the remote object will be accessed and return its data so that the programmers code will function properly. Such a system thus maximizes the inherent advantages of object oriented methodologies by taking full advantage of their modularity and encapsulation.
Efforts to further extend the advantages of object oriented programming techniques have included the development of methodologies to enhance the modularity of programming objects. Once such effort has included development of the concept of relations or relationships between objects. Object relationships are associations between objects from one or more classes (Rumbaugh 1987). The use of relationships allows the object programmer to express clearly the associations and constraints among objects that would otherwise have to be buried in the implementation code of object, thereby reducing the modularity of the object. The externalization of references between objects that is provided by the use of relationships permits a symmetric, non-redundant model that combines the object oriented computing model with the entity relationship model that is found in database theory. Such strategies are particularly useful for modeling systems of interrelated objects, as these systems can be thought of in very natural terms. For example, the modeling of a document contained in a folder, which is a popular metaphor for file storage in many computer systems, can be modeled by relating a folder object with a document object through a xe2x80x9ccontainmentxe2x80x9d relationship. Such a model expresses the relationships in a very natural manner to the real-world case of a folder in which is placed a document for storage.
The implementation of these concepts in distributed object oriented systems remains a difficult task. For example, methods are required to determine whether two or more object references are directed to the same object. The need to make such determinations is also relevant to the implementation of relationships among objects. Often it is useful for the programmer or system administrator to xe2x80x9cmapxe2x80x9d the chain of relationships among associated objects.
Furthermore, with respect to the implementation of relationship methodologies and distributed object oriented systems methods must also exist to ensure that relationships are created among objects in a logically consistent manner. In other words, it is highly desirable to have a method that would prevent, e.g., a situation in which a document was placed in a containment relationship to a folder. Finally, it is also desirable to provide a method for identifying objects in relationships in a highly efficient manner so as to reduce the overhead imposed by the operating system.
The present invention includes methods and apparatus for managing relationships among objects in a distributed object system. Using the methods and apparatus of the invention the limitations imposed on such systems by the need to identify object references which refer to identical objects, provide for the logically consistent formation of relationships among objects and enhance system efficiency by providing for efficient identification of objects associated through relationships are addressed.
In one aspect, the present invention includes a computer implemented method for determining whether a first object is identical to a second object in a distributed object system including a first object reference residing in a process running in a computer memory, which first object reference refers to the first object, and a second object reference stored in a computer memory that refers to the second object. The method includes first providing an identifier for each of the first and second objects that is effective to identify uniquely those objects within the distributed object system. The object reference to the second object is then passed to the first object, which initiates a request to the second object for that object""s unique identifier. The first object then determines if its unique identifier is identical to the second object""s unique identifier. In a preferred embodiment, the unique identifier comprises a network address, a process identifier, a temporal value, and an incrementor value.
In another aspect, the present invention provides a computer implemented method for checking the consistency of a relationship to be created among two or more objects in a distributed object system. The method of the invention includes passing a role under computer control from each object to be related to a relationship factory mechanism effective to create the relationship among the objects. A determination is made as to whether each role passed to the relationship factory is of the appropriate type for the desired relationship. In a preferred embodiment, the method includes the steps of: creating a type check array; creating an expectation array; and performing a type check for each role passed to the factory. The type check includes comparing a role that is passed to the relationship factory with at least one expected role type to determine whether the passed role is of the same type of the expected role type, and incrementing an element of the type check array in response to a determination that the passed role is of the same type of the expected role type. The type check array is then compared against the expectation array to determine whether the role types passed to the relationship factory match the role types expected by the relationship factory.
In still another aspect, the present invention includes a computer implemented method for obtaining an object reference for a first object having a first object role which first object is related to a second object having a second object role, wherein the first and second objects are related by a relationship object. In the method, the object reference of the relationship object and the role name of the first object role are passed to the second object role. The relationship object reference and the first object role name are compared with entries contained in a data structure cached in the second object role to determine if the data structure includes the object reference for the first object. In a preferred embodiment, the method further includes querying the relationship object for the first object""s role name as well as the object reference for the first object in response to determining that the first object role name is not included in the data structure cached with the second object role. The object reference for the first object is then stored in the data structure cached in the second object role.
In yet another aspect, the present invention includes a computer implemented method for obtaining the object reference for a first object role related to a first object which first object is related to a second object having a second object role by a relationship object. In the method, the object reference of the relationship object and the role name of the first object role are passed to the second object role. These are compared with entries contained in the data structure cached in the second object role to determine whether the object reference for the first object role is contained in the data structure.
The present invention also provides apparatus for determining whether two object references in the distributed object system refer to identical objects. The apparatus includes a first object reference associated with the first object and a second object reference associated with the second object; an identity mechanism for providing an identifier for each of the first and second objects which identifier is effective to identify uniquely each of the objects in a distributed object system; a communications medium for passing the second object reference to the first object, and for initiating a request from the first object to the second object for the unique identifier of the second object; and an identity checking mechanism for determining whether the first object""s unique identifier is identical to the second object""s unique identifier.
The present invention also includes an apparatus for checking the validity of a desired relationship to be created among two or more objects and the distributed object system. The apparatus includes a communications medium for passing a role from each object to be related to a relationship factory mechanism that is effective to create the desired relationship among the objects. A consistency evaluation mechanism determines whether the proper number of roles for the desired relationship have been passed to the relationship factory mechanism; and whether each role passed to the relationship factory is of the appropriate type for the desired relationship.
In still another aspect, the present invention includes an apparatus for obtaining the object reference for a first object having a first object role, which first object is related to a second object having a second object role by a relationship object. The apparatus comprises a communications medium for passing the object reference of the relationship object and the role name of the first object role to the second object role; and a comparator for comparing the relationship object reference and the first object role name with entries contained in the data structure cached in the second object role to determine whether the object reference for the first object role is contained in the data structure.
The present invention further includes an apparatus for obtaining the object reference for a first object role related to a first object which first object is related to a second object having a second object role by a relationship object. The apparatus includes a communications medium for passing the object reference of the relationship object and the role name of the first object role to the second object role; and a comparator for comparing the relationship object reference and the first object role name with entries contained in the data structure cached in the second object role to determine whether the object reference for the first object role is contained in the data structure.